//
//  OcrViewFactory.m
//  ocr_plugin
//
//  Created by apple on 2021/9/15.
//

#import "OcrViewFactory.h"
#import "OcrPlatformView.h"

@implementation OcrViewFactory
{
    NSObject<FlutterBinaryMessenger> * _messenger;
}

- (instancetype)initWithMessenger:(NSObject<FlutterBinaryMessenger> *)messenger{
    self = [super init];
    if(self){
        _messenger = messenger;
    }
    return self;
}

- (NSObject<FlutterMessageCodec>*)createArgsCodec {
    return [FlutterStandardMessageCodec sharedInstance];
}

- (nonnull NSObject<FlutterPlatformView> *)createWithFrame:(CGRect)frame
                                            viewIdentifier:(int64_t)viewId
                                                 arguments:(id _Nullable)args {
    return [[OcrPlatformView alloc] initWithFrame:frame
                                           viewId:viewId
                                        arguments:args
                                  binaryMessenger:_messenger];
}

@end
